home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / window.h < prev   
C/C++ Source or Header  |  1999-04-02  |  5KB  |  128 lines

  1. #ifndef _WINDOW_H_
  2. #define    _WINDOW_H_
  3.  
  4. #include "osd_cpu.h"
  5. #include "osd_dbg.h"
  6.  
  7. // This is our window structure
  8.  
  9. struct sWindow
  10. {
  11.     UINT8 filler;        // Character
  12.     UINT8 prio;         // This window's priority
  13.     UINT32 x;            // X Position (in characters) of our window
  14.     UINT32 y;            // Y Position (in characters) of our window
  15.     UINT32 w;            // X Size of our window (in characters)
  16.     UINT32 h;            // Y Size (lines) of our window (in character lengths)
  17.     UINT32 cx;            // Current cursor's X position
  18.     UINT32 cy;            // Current cursor's Y position
  19.     UINT32 flags;        // Window's attributes (below)
  20.     UINT8 co_text;        // Default color
  21.     UINT8 co_frame;     // Frame color
  22.     UINT8 co_title;     // Title color
  23.     UINT8 saved_text;   // Character under the cursor position
  24.     UINT8 saved_attr;    // Attribute under the cursor position
  25.  
  26.     // Stuff that needs to be saved off differently
  27.  
  28.     char    *title; // Window title (if any)
  29.     UINT8    *text;    // Pointer to video data - characters
  30.     UINT8    *attr;    // Pointer to video data - attributes
  31.  
  32.     // These are the callbacks when certain things happen. All fields have been
  33.     // updated BEFORE the call. Return FALSE if the moves/resizes/closes/refocus aren't
  34.     // accepted.
  35.  
  36.     UINT32 (*Resize)(UINT32 idx, struct sWindow *);
  37.     UINT32 (*Close)(UINT32 idx, struct sWindow *);
  38.     UINT32 (*Move)(UINT32 idx, struct sWindow *);
  39.     UINT32 (*Refocus)(UINT32 idx, struct sWindow *);  // Bring it to the front
  40. };
  41.  
  42. // These defines are for various aspects of the window
  43.  
  44. #define    BORDER_LEFT            0x01     // Border on left side of window
  45. #define    BORDER_RIGHT        0x02    // Border on right side of window
  46. #define    BORDER_TOP            0x04    // Border on top side of window
  47. #define BORDER_BOTTOM        0x08    // Border on bottom side of window
  48. #define    HIDDEN                0x10    // Is it hidden currently?
  49. #define    CURSOR_ON            0x20    // Is the cursor on?
  50. #define NO_WRAP             0x40    // Do we actually wrap at the right side?
  51. #define    NO_SCROLL            0x80    // Do we actually scroll it?
  52. #define SHADOW                0x100    // Do we cast a shadow?
  53. #define MOVEABLE            0x200    // Is this Window moveable?
  54. #define RESIZEABLE            0x400    // IS this Window resiable?
  55.  
  56. #define MAX_WINDOWS         32        // Up to 32 windows active at once
  57. #define TAB_STOP            8        // 8 Spaces for a tab stop!
  58.  
  59. #define AUTO_FIX_XYWH        TRUE
  60. #define NEWLINE_ERASE_EOL   TRUE    // Shall newline also erase to end of line?
  61.  
  62. // Special characters
  63.  
  64. #define    CHAR_CURSORON        'Û'    // Cursor on character
  65. #define    CHAR_CURSOROFF        ' '    // Cursor off character
  66.  
  67. // Standard color set for IBM character set. DO NOT ALTER!
  68. // I did, because we already have an enum in osd_dbg.h ;-)
  69.  
  70. #define WIN_BLACK           BLACK
  71. #define WIN_BLUE            BLUE
  72. #define WIN_GREEN            GREEN
  73. #define WIN_CYAN            CYAN
  74. #define WIN_RED             RED
  75. #define WIN_MAGENTA         MAGENTA
  76. #define WIN_BROWN            BROWN
  77. #define WIN_WHITE            LIGHTGRAY
  78. #define WIN_GRAY            DARKGRAY
  79. #define WIN_LIGHT_BLUE        LIGHTBLUE
  80. #define WIN_LIGHT_GREEN     LIGHTGREEN
  81. #define WIN_LIGHT_CYAN        LIGHTCYAN
  82. #define WIN_LIGHT_RED        LIGHTRED
  83. #define WIN_LIGHT_MAGENTA    LIGHTMAGENTA
  84. #define WIN_YELLOW            YELLOW
  85. #define WIN_BRIGHT_WHITE    WHITE
  86.  
  87. #define    WIN_BRIGHT    0x08
  88.  
  89. // Externs!
  90.  
  91. extern UINT32 screen_w;
  92. extern UINT32 screen_h;
  93.  
  94. extern void win_erase_eol(UINT32 idx, UINT8 bChar);
  95. extern INT32 win_putc(UINT32 idx, UINT8 bChar);
  96. extern UINT32 win_open(UINT32 idx, struct sWindow *psWin);
  97. extern UINT32 win_init_engine(UINT32 w, UINT32 h);
  98. extern UINT32 win_is_initalized(UINT32 idx);
  99. extern void win_exit_engine(void);
  100. extern void win_close(UINT32 idx);
  101. extern INT32 win_vprintf(UINT32 idx, const char *pszString, va_list arg);
  102. extern INT32 DECL_SPEC win_printf(UINT32 idx, const char *pszString, ...) ARGFMT;
  103. extern UINT32 DECL_SPEC win_set_title(UINT32 idx, const char *pszTitle, ... ) ARGFMT;
  104. extern UINT32 win_get_cx(UINT32 idx);
  105. extern UINT32 win_get_cy(UINT32 idx);
  106. extern UINT32 win_get_cx_abs(UINT32 idx);
  107. extern UINT32 win_get_cy_abs(UINT32 idx);
  108. extern UINT32 win_get_x_abs(UINT32 idx);
  109. extern UINT32 win_get_y_abs(UINT32 idx);
  110. extern UINT32 win_get_w(UINT32 idx);
  111. extern UINT32 win_get_h(UINT32 idx);
  112. extern void win_set_w(UINT32 idx, UINT32 w);
  113. extern void win_set_h(UINT32 idx, UINT32 w);
  114. extern void win_set_color(UINT32 idx, UINT32 color);
  115. extern void win_set_title_color(UINT32 idx, UINT32 color);
  116. extern void win_set_frame_color(UINT32 idx, UINT32 color);
  117. extern void win_set_curpos(UINT32 idx, UINT32 x, UINT32 y);
  118. extern void win_set_cursor(UINT32 idx, UINT32 dwCursorState);
  119. extern void win_hide(UINT32 idx);
  120. extern void win_show(UINT32 idx);
  121. extern void win_update(UINT32 idx);
  122. extern UINT8 win_get_prio(UINT32 idx);
  123. extern void win_set_prio(UINT32 idx, UINT8 prio);
  124. extern void win_move(UINT32 idx, UINT32 dwX, UINT32 dwY);
  125. extern void win_invalidate_video(void);
  126.  
  127. #endif
  128.